package com.example.demo.dao;

import com.example.demo.domain.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Set;

@Mapper
@CacheNamespaceRef(name = "com.example.demo.dao.StudentDao")
public interface StudentDao {

    //    @Select("select * from student")
    List<Student> getAll();

//    @SelectProvider
    List<Student> findAll();

    Student getOne(String sid);

    @Select("select * from student")
//    这条语句不需要缓存时
//    @Options(useGeneratedKeys = true,keyProperty = "sId",keyColumn = "s_id", useCache = false,flushCache = )
    List<Student> getAll2();

    int insertStu(Student student);

    int insertStuList(List<Student> list);

    int deleteStu(String sid);

    int deleteStuList(Set<String> set);

    int updateStu(Student student);
}
